﻿Public Class main
    Friend modulo As New secciones
    Private Sub IngresoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles IngresoToolStripMenuItem.Click
        login.MdiParent = Me
        login.Show()
    End Sub

    Private Sub SalirToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SalirToolStripMenuItem.Click
        If MsgBox("¿Está seguro que desea salir?", MsgBoxStyle.YesNo, "Cerrar Aplicacion") = MsgBoxResult.Yes Then
            Me.Close()
        End If
    End Sub

    Private Sub main_Disposed(sender As Object, e As System.EventArgs) Handles Me.Disposed
        salir(login.usuario.id)
    End Sub

    Private Sub main_FormClosed(sender As Object, e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        salir(login.usuario.id)

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        login.MdiParent = Me
        login.Show()
        'UsuariosToolStripMenuItem.Enabled = False
        'SucursalesToolStripMenuItem.Enabled = False
        'BodegaToolStripMenuItem.Enabled = False
        'EstudiosToolStripMenuItem.Enabled = False
        'KitsToolStripMenuItem2.Enabled = False
        'MovimientosToolStripMenuItem.Enabled = False
        'InvestigadoresToolStripMenuItem.Enabled = False
        modulo.usuario = "Usuarios"
        modulo.movimiento = "Movimientos"
        modulo.bodega = "Bodegas"
        modulo.estudio = "Estudios"
        modulo.kit = "Kits"
        modulo.investigador = "Investigador"
        modulo.inspectores = "Inspectores"
        modulo.grupos = "Grupos"
    End Sub

    Private Sub LogoutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogoutToolStripMenuItem.Click
        UsuariosToolStripMenuItem.Enabled = False
        ' SucursalesToolStripMenuItem.Enabled = False
        BodegaToolStripMenuItem.Enabled = False
        EstudiosToolStripMenuItem.Enabled = False
        KitsToolStripMenuItem2.Enabled = False
        MovimientosToolStripMenuItem.Enabled = False
        InvestigadoresToolStripMenuItem.Enabled = False
        IngresoToolStripMenuItem.Enabled = True
        InspectoresDeToolStripMenuItem.Enabled = False
        LogoutToolStripMenuItem.Enabled = False
        'saco el id de usuario en la session
        salir(login.usuario.id)
        Me.Text = "Sistema Sanofis"
    End Sub

    Private Sub MantenedorToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MantenedorToolStripMenuItem.Click
        'Dim nu As New nuevo_usuario
        nuevo_usuario.MdiParent = Me
        nuevo_usuario.Show()
    End Sub


    Private Sub AdministrarToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles AdministrarToolStripMenuItem.Click
        'Dim us As New man_usuarios
        man_usuarios.MdiParent = Me
        man_usuarios.Show()
    End Sub

    Private Sub GruposToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles GruposToolStripMenuItem.Click
        man_grupos.MdiParent = Me
        man_grupos.Show()
    End Sub

    Private Sub DepositarToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles DepositarToolStripMenuItem.Click
        man_bodegas.MdiParent = Me
        man_bodegas.Show()
    End Sub

    Private Sub MantenedorToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles MantenedorToolStripMenuItem1.Click
        nueva_bodega.MdiParent = Me
        nueva_bodega.Show()
    End Sub

    Private Sub ResultadosToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ResultadosToolStripMenuItem.Click
        man_estudios.MdiParent = Me
        man_estudios.Show()
    End Sub

    Private Sub DepositarToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs)
        depositar_bodega.MdiParent = Me
        depositar_bodega.Show()
    End Sub

    Private Sub EstudiosToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles EstudiosToolStripMenuItem1.Click
        nuevo_estudio.MdiParent = Me
        nuevo_estudio.Show()
    End Sub

    Private Sub MenuStrip1_ItemClicked(sender As System.Object, e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles MenuStrip1.ItemClicked

    End Sub

    Private Sub MantenedorToolStripMenuItem2_Click(sender As System.Object, e As System.EventArgs) Handles MantenedorToolStripMenuItem2.Click
        man_kits.mdiparent = Me
        man_kits.show()
    End Sub

    Private Sub OrganizarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OrganizarToolStripMenuItem.Click
        man_investigadores.MdiParent = Me
        man_investigadores.Show()
    End Sub

    Private Sub NuevoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NuevoToolStripMenuItem.Click
        nuevo_investigador.MdiParent = Me
        nuevo_investigador.Show()
    End Sub

    Private Sub VerRegistroToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles VerRegistroToolStripMenuItem.Click
        man_movimientos.MdiParent = Me
        man_movimientos.Show()
    End Sub
End Class
